# 示例: 使用 abc 模块模拟接口
from abc import ABC, abstractmethod


class Animal(ABC):
    @abstractmethod
    def speak(self):
        pass


class Dog(Animal):
    def speak(self):
        return "汪汪！"


class Cat(Animal):
    def speak(self):
        return "喵喵！"


# 调用
dog = Dog()
cat = Cat()
print(dog.speak())  # 输出: 汪汪！
print(cat.speak())  # 输出: 喵喵！
